﻿using Mapster;
using System;
using System.Collections.Generic;

namespace Raffles.OA.Data
{
    /// <summary>
    /// 日 期：2024-07-16 15:04:38
    /// 描 述：项目管理参数类
    /// </summary>
    public class ProjectDto
    {
        public int? Id { get; set; }
        /// <summary>
        /// 表单类型
        /// </summary>
        public string FormType { get; set; }

        /// <summary>
        /// 渠道
        /// </summary>
        public int CustomerId { get; set; }
        /// <summary>
        /// 渠道
        /// </summary>
        public string CustomerName { get; set; }
        /// <summary>
        /// 出发时间
        /// </summary>
        public DateTime? DepartureDate { get; set; }

        /// <summary>
        /// 回程时间
        /// </summary>
        public DateTime? ReturnDate { get; set; }

        /// <summary>
        /// 项目名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 出行天数
        /// </summary>
        public int? DayTotal { get; set; }

        /// <summary>
        /// 合同编号
        /// </summary>
        public string ContractCode { get; set; }

        /// <summary>
        /// 报价日期
        /// </summary>
        public DateTime? QuotationDate { get; set; }

        /// <summary>
        /// 成人数量
        /// </summary>
        public int? AdultTotal { get; set; }

        /// <summary>
        /// 儿童数量
        /// </summary>
        public int? ChildTotal { get; set; }

        /// <summary>
        /// 领队人数
        /// </summary>
        public int? TeamLeader { get; set; } 

        /// <summary>
        /// 结算汇率
        /// </summary>
        public decimal? SettlementRate { get; set; }

        /// <summary>
        /// 是否显示税后
        /// </summary>
        public bool? IsTaxShow { get; set; }

        /// <summary>
        /// 结算税率
        /// </summary>
        public decimal? TaxRate { get; set; } 
        /// <summary>
        /// 付款汇率
        /// </summary>
        public decimal? PaymentRate { get; set; }
        /// <summary>
        /// 结算货币
        /// </summary>
        public string SettlementCurrency { get; set; }
        /// <summary>
        /// 结算货币
        /// </summary>
        public string SettlementCurrencyCN { get; set; }
        /// <summary>
        /// 行程分段
        /// </summary>
        public List<int> CountrySegment { get; set; } = new List<int>();
        /// <summary>
        /// 行程分段
        /// </summary>
        public string CountrySegmentCN { get; set; }
        /// <summary>
        /// 参与人员
        /// </summary>
        public List<int?> InvolveId { get; set; } = new List<int?>();
        /// <summary>
        /// 报价类目
        /// </summary>
        public List<string> QuotationItemCode { get; set; } = new List<string>();

        /// <summary>
        /// 销售金额(新币)
        /// </summary>
        public string TotalSGDBeforeTax { get; set; }

        /// <summary>
        /// 销售金额(人民币)-税前
        /// </summary>
        public string TotalRMBBeforeTax { get; set; }
        /// <summary>
        /// 销售金额(人民币)-税后
        /// </summary>
        public string TotalRMBAfterTax { get; set; }
        /// <summary>
        /// 人均(人民币)
        /// </summary>
        public string AverageRMBBeforeTax { get; set; }
        /// <summary>
        /// 销售人员
        /// </summary>
        public string SaleManagerName { get; set; }
        /// <summary>
        /// 行程安排
        /// </summary>
        public List<TripItem> TripItemList { get; set; } = new List<TripItem>();

        /// <summary>
        /// 报价项
        /// </summary>
        public List<QuotationItem> QuotationItemList { get; set; } = new List<QuotationItem>();

        /// <summary>
        /// 付款项
        /// </summary>
        public List<PayMoney> PayMoneyList { get; set; } = new List<PayMoney>();


        #region 付款

        /// <summary>
        /// 定金支付比例
        /// </summary>
        public decimal? AdvancePayRate { get; set; }

        /// <summary>
        /// 定金SGD
        /// </summary>
        public decimal? AdvancePaySGD { get; set; }

        /// <summary>
        /// 定金RMB
        /// </summary>
        public decimal? AdvancePayRMB { get; set; }

        /// <summary>
        /// 预付款日期
        /// </summary>
        public DateTime? DtPrePay { get; set; }

        /// <summary>
        /// 预付款支付比例
        /// </summary>
        public decimal? PrePayRate { get; set; }

        /// <summary>
        /// 预付款SGD
        /// </summary>
        public decimal? PrePaySGD { get; set; }

        /// <summary>
        /// 预付款RMB
        /// </summary>
        public decimal? PrePayRMB { get; set; }

        /// <summary>
        /// 尾款日期
        /// </summary>
        public DateTime? DtRemainPay { get; set; }

        /// <summary>
        /// 尾款支付比例
        /// </summary>
        public decimal? RemainPayRate { get; set; }

        /// <summary>
        /// 尾款SGD
        /// </summary>
        public decimal? RemainPaySGD { get; set; }

        /// <summary>
        /// 尾款RMB
        /// </summary>
        public decimal? RemainPayRMB { get; set; }

        #endregion 付款
    }

    /// <summary>
    /// 行程天数
    /// </summary>
    public class TripItem
    {
        /// <summary>
        /// 行程分段
        /// </summary>
        public int SegmentId { get; set; }
        /// <summary>
        /// 天数
        /// </summary>
        public int Day { get; set; }
        /// <summary>
        /// 日期
        /// </summary>
        public DateTime TripDate { get; set; }
        /// <summary>
        /// 行程城市,逗号分隔
        /// </summary>
        public List<int> TripPlaceId { get; set; } = new List<int>();
        /// <summary>
        /// 行程城市,逗号分隔
        /// </summary>
        public List<string> TripPlaceName { get; set; } = new List<string>();
        /// <summary>
        /// 是否更导
        /// </summary>
        public bool IsGuideChange { get; set; }
        /// <summary>
        /// 航班
        /// </summary>
        public string FlightNo { get; set; }
        /// <summary>
        /// 起降日期
        /// </summary>
        public string FlightTime { get; set; }
        /// <summary>
        /// 服务(接机、送机)
        /// </summary>
        public string Service { get; set; }
        /// <summary>
        /// 工时
        /// </summary>
        public string ServiceHour { get; set; }
        /// <summary>
        /// 早餐
        /// </summary>
        public string BreakfastId { get; set; }
        /// <summary>
        /// 早餐
        /// </summary>
        public string BreakfastName { get; set; }
        /// <summary>
        /// 午餐
        /// </summary>
        public string LunchId { get; set; }
        /// <summary>
        /// 午餐
        /// </summary>
        public string LunchName { get; set; }
        /// <summary>
        /// 晚餐
        /// </summary>
        public string DinnerId { get; set; }
        /// <summary>
        /// 晚餐
        /// </summary>
        public string DinnerName { get; set; }


    }

    /// <summary>
    /// 报价项
    /// </summary>
    public class QuotationItem
    {
        /// <summary>
        /// 类型
        /// </summary>
        public string QuotationItemCode { get; set; }
        /// <summary>
        /// 行程分段
        /// </summary>
        public int SegmentId { get; set; } 
        /// <summary>
        /// 安排
        /// </summary>
        public int? ItemId { get; set; }
        /// <summary>
        /// 安排
        /// </summary>
        public string ItemName { get; set; }
        /// <summary>
        /// 团组培训明细(初版，目前不用)
        /// </summary>
        public List<ItemDetail> ItemDetail { get; set; } = new List<ItemDetail>();
        /// <summary>
        /// 团组培训明细
        /// </summary>
        public List<ActivityItemDetail> ActivityDetail { get; set; } = new List<ActivityItemDetail>();
        /// <summary>
        /// 交通导游明细
        /// </summary>
        public List<TransportItemDetail> TransportDetail { get; set; } = new List<TransportItemDetail>();
        /// <summary>
        /// 数量
        /// </summary>
        public int? Quantity { get; set; }
        /// <summary>
        /// 人数
        /// </summary>
        public int Number { get; set; }
        /// <summary>
        /// 销售单价
        /// </summary>
        public decimal? SalePrice { get; set; }
        /// <summary>
        /// 成本单价
        /// </summary>
        public decimal Price { get; set; }
        /// <summary>
        /// 总价
        /// </summary>
        public decimal? SaleTotal { get; set; }
        /// <summary>
        /// 总价
        /// </summary>
        public decimal Total { get; set; } 
    }

    /// <summary>
    /// 报价项明细
    /// </summary>
    public class ItemDetail
    {
        /// <summary>
        /// 行程分段
        /// </summary>
        public int SegmentId { get; set; }
        public string Code { get; set;}
        public int Id { get; set; }
        public int? Quantity { get; set; }
        public string Name { get; set; }
        public decimal? Price { get; set; }
    }

    /// <summary>
    /// 交通导游报价项明细
    /// </summary>
    public class TransportItemDetail
    {
        /// <summary>
        /// 报价项
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 行程分段
        /// </summary>
        public int SegmentId { get; set; }
        /// <summary>
        /// 选项Id
        /// </summary>
        public int ItemId { get; set; }
        /// <summary>
        /// 天数
        /// </summary>
        public int Day { get; set; }
        /// <summary>
        /// 使用时间
        /// </summary>
        public string UseTime { get; set; }
        /// <summary>
        /// 计划用时
        /// </summary>
        public string PlanHour { get; set; }
        /// <summary>
        /// 超时数
        /// </summary>
        public string OverTime { get; set; }
        /// <summary>
        /// 接送服务费用
        /// </summary>
        public decimal? ServiceFee { get; set; }
        /// <summary>
        /// 工资费用
        /// </summary>
        public decimal? SalaryFee { get; set; }
        /// <summary>
        /// 超时费
        /// </summary>
        public decimal? OverTimeFee { get; set; }
        /// <summary>
        /// 合计费用
        /// </summary>
        public decimal? TotalFee { get; set; }
    }
    /// <summary>
    /// 团组培训报价项明细
    /// </summary>
    public class ActivityItemDetail
    {
        /// <summary>
        /// 报价项
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 行程分段
        /// </summary>
        public int SegmentId { get; set; }
        /// <summary>
        /// 选项Id
        /// </summary>
        public int ItemId { get; set; }
        public string Name { get; set; }
        public string ItemName { get; set; }
        public string ItemCostName { get; set; }
        public decimal? ItemCostPrice { get; set; }
        public decimal? ItemSalePrice { get; set; }
        public decimal? ItemQty { get; set; }
        public bool Mark { get; set; }
    }
    

    /// <summary>
    /// 付款明细
    /// </summary>
    public class PayMoney
    {
        /// <summary>
        /// 付款类型
        /// </summary>
        public string PayType { get; set; }
        /// <summary>
        /// 付款日期
        /// </summary>
        public DateTime? PayDate { get; set; }
        /// <summary>
        /// 付款比例
        /// </summary>
        public decimal? PayRate { get; set; }
        /// <summary>
        /// 付款SGD
        /// </summary>
        public decimal? PaySGD { get; set; }
        /// <summary>
        /// 付款RMB
        /// </summary>
        public decimal? PayRMB { get; set; }
    }


    /// <summary>
    /// 运营成本
    /// </summary>
    public class OperateCost
    {
        public int? ProjectId { get; set; }
        public List<OperateCostItem> OperateCostItems { get; set; } = new List<OperateCostItem>();
    }

    /// <summary>
    /// 运营成本明细
    /// </summary>
    public class OperateCostItem
    {
        /// <summary>
        /// 项目Id
        /// </summary>
        public int? ProjectId { get; set; }
        /// <summary>
        /// 关键字 
        /// </summary>
        public string Code { get; set; }
        /// <summary>
        /// 成本名称 
        /// </summary>
        public string Name { get; set; }
        /// <summary>
        /// 比率
        /// </summary>
        public decimal? Rate { get; set; }
        /// <summary>
        /// 成本费用
        /// </summary>
        public decimal Amount { get; set; } 
        /// <summary>
        /// 是否默认
        /// </summary>
        public bool IsDefault { get; set; }
    }
    public class ProjectQuotationItemDto
    {
        public int? Key { get; set; }
        public string Value { get; set; }
        public int IsDefault { get; set; }
    }

    public class ValidateResult
    {
        public string Title { get; set; }
        public string Items { get; set; }
    }
}